<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<s:include value="/commun/header.jsp" />

<div id="body">
<h2>Messages du sujet <s:property value="topic.nom"/></h2>


<s:iterator value="posts" status="status">
<div class="post">
<p>
Message posté par <s:property value="auteur.login"/> le <s:date name="date" format="dd/MM/yyyy hh:mm:ss" /><br /><br />
<s:if test="%{auteur.id==#session.uid}">
<s:url id="deletePost" action="deletePost"><s:param name="topic.id" value="topic.id"/><s:param name="post.id" value="id"/></s:url>
<s:a href="%{deletePost}">Supprimer</s:a> 
<s:url id="editPost" action="setUpForInsertOrUpdateResponse"><s:param name="topic.id" value="topic.id"/><s:param name="post.id" value="id"/></s:url>
<s:a href="%{editPost}">Editer</s:a></p>
</s:if>
<p>
<s:property value="texte"/>
</p>
</div>
</s:iterator>

<p>
<s:url id="response" action="setUpForInsertOrUpdateResponse"><s:param name="topic.id" value="topic.id"/></s:url>
<s:a href="%{response}">Poster une réponse</s:a>
</p>
<p>
<s:url id="forum" action="viewForum"><s:param name="projet.id" value="projet.id"/></s:url>
<s:a href="%{forum}">Retour au forum</s:a>
</p>

</div>

<s:include value="/commun/footer.jsp"/>